package tech.dongliang.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tech.dongliang.system.model.SysDept;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author xdzhang
 * @since 2019-01-18
 */
public interface SysDeptDao extends BaseMapper<SysDept> {
    @Update("UPDATE sys_dept SET delFlag=-1 WHERE id = #{deptId}")
    int remove(@Param("deptId") Integer deptId) throws Exception;

    @Select("SELECT count(*) FROM sys_user WHERE deptId = #{deptId}")
    int getDeptUserNumber(Integer deptId) throws Exception;
}
